package com.twu.bibilioteca;

import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: dixithk
 * Date: 6/20/14
 * Time: 10:43 AM
 * To change this template use File | Settings | File Templates.
 */
public class PresentUsers {

    private static ArrayList<User> users = new ArrayList<User>();

    public static void signUp (User user)
    {
        users.add(user);
    }

    public User authenticateUser(User user)
    {
        for(User registerUser : users)
        {
            if(registerUser.getLogin().equals(user.getLogin()))
                return registerUser;
        }
        return null;
    }

    public boolean  userLoggedIn()
    {
        return !users.isEmpty();
    }


    public static void removeUser()
    {
      users.clear();
    }


}
